function initMongodb() {
  var express = require("express");
  var router = express.Router();

  /* GET home page. */
  router.get("/", function (req, res, next) {
    res.render("index", { title: "Express" });
  });

  let mogse = require("mongoose");

  mogse.set("strictQuery", true); //启用严格查询模式。

  let url = "mongodb://10.200.50.198:27017/homeIndex";

  mogse.connect(url);

  mogse.connection.once("open", () => {
    console.log("+++++++++");
  });

  mogse.connection.on("error", () => {
    console.log("-------------");
  });

  mogse.connection.on("close", () => {
    console.log("连接关闭");
  });

}
module.exports = initMongodb;
